<template>
  <div>
    <h4>{{character.title}}</h4>
    <hr />
    <div class="content" v-html="character.content"></div>
  </div>
</template>
<script>
export default {
  created () {
    this.id = this.$route.params.id
    this.getGoodsdesc()
  },
  data () {
    return {
      // 当前商品的id
      id: '',
      // 商品文字信息
      character: {}
    }
  },
  methods: {
    async getGoodsdesc () {
      // 获取图文介绍数据
      const { data: res } = await this.$axios.get('/api/goods/getdesc/' + this.id)
      // console.log(res.message)
      this.character = res.message[0]
    }
  }
}
</script>
<style scoped lang="less">
h4{
    font-size: 16px;
    color: #226aff;
    text-align: center;
    margin: 15px 0;
}
.content{
  padding: 0 5px;
}
</style>
